package com.uenpay.im.ui.old.activity.chat.manage;

import android.content.Context;
import android.view.View;
import android.view.View.OnLongClickListener;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.aswife.ui.GifImageView;
import com.aswife.ui.MaskImageView;
import com.qiyunxin.android.http.view.BubbleImageView;
import com.qiyunxin.android.http.view.BubbleRightImageView;
import com.qyx.android.weight.view.CircularProgressView;
import com.uenpay.im.R;
import com.uenpay.im.view.LocationView;
import com.uenpay.im.view.PlayRecordView;
import com.uenpay.im.weight.RoundImageView;

/**
 * @author SL
 * @created 2016-4-22 下午3:55:15
 * @copyRight http://www.qiyunxin.com
 * @function 获取会话item布局
 */
public class ChatItemViewManager {

    /**
     * 获取item布局
     *
     * @param type
     * @param mContext
     * @return
     */
    public static View getConvertView(int type, Context mContext) {
        View convertView = null;
        switch (type) {

            case ChatTypeManage.TALK_TIME:
                convertView = View.inflate(mContext, R.layout.talk_list_item_time,
                        null);
                break;
            case ChatTypeManage.TALK_UNREAD_MSG:
                convertView = View.inflate(mContext,
                        R.layout.talk_list_item_unread_msg_line, null);
                break;
            case ChatTypeManage.TALK_SYSTEM:
                convertView = View.inflate(mContext,
                        R.layout.talk_list_item_system, null);
                break;
            case ChatTypeManage.TALK_RED_SYSTEM:
                convertView = View.inflate(mContext,
                        R.layout.talk_list_item_red_system, null);
                break;
            case ChatTypeManage.TALK_RECEIVED_TEXT:
                convertView = View.inflate(mContext,
                        R.layout.talk_list_item_received_text, null);
                break;
            case ChatTypeManage.TALK_RECEIVED_IMAGE:
                convertView = View.inflate(mContext,
                        R.layout.talk_list_item_received_image, null);
                break;
            case ChatTypeManage.TALK_RECEIVED_AUDIO:
                convertView = View.inflate(mContext,
                        R.layout.talk_list_item_received_audio, null);
                break;
            case ChatTypeManage.TALK_RECEIVED_LOCATION:
                convertView = View.inflate(mContext,
                        R.layout.talk_list_item_received_location, null);
                break;
            case ChatTypeManage.TALK_RECEIVED_GIF:
                convertView = View.inflate(mContext,
                        R.layout.talk_list_item_received_gif, null);
                break;
            case ChatTypeManage.TALK_RECEIVED_FILE:
                convertView = View.inflate(mContext,
                        R.layout.talk_list_item_received_file, null);
                break;
            case ChatTypeManage.TALK_RECEIVED_RED:
                convertView = View.inflate(mContext,
                        R.layout.talk_list_item_received_money, null);
                break;
            case ChatTypeManage.TALK_RECEIVED_CRAD:
                convertView = View.inflate(mContext,
                        R.layout.talk_list_item_received_crad, null);
                break;
            case ChatTypeManage.TALK_RECEIVED_VIDEO_CHAT:
                convertView = View.inflate(mContext,
                        R.layout.talk_list_item_received_video_chat, null);
                break;
            case ChatTypeManage.TALK_RECEIVED_OA:
                convertView = View.inflate(mContext,
                        R.layout.talk_list_item_received_oa, null);
                break;
            case ChatTypeManage.TALK_RECEIVED_OA_NOTICE:
                convertView = View.inflate(mContext,
                        R.layout.talk_list_item_received_notice, null);
                break;
            case ChatTypeManage.TALK_RECEIVED_TASK:
                convertView = View.inflate(mContext,
                        R.layout.talk_list_item_received_task, null);
                break;
            case ChatTypeManage.TALK_SEND_TEXT:
                convertView = View.inflate(mContext,
                        R.layout.talk_list_item_send_text, null);
                break;
            case ChatTypeManage.TALK_SEND_IMAGE:
                convertView = View.inflate(mContext,
                        R.layout.talk_list_item_send_image, null);
                break;
            case ChatTypeManage.TALK_SEND_AUDIO:
                convertView = View.inflate(mContext,
                        R.layout.talk_list_item_send_audio, null);
                break;
            case ChatTypeManage.TALK_SEND_LOCATION:
                convertView = View.inflate(mContext,
                        R.layout.talk_list_item_send_location, null);
                break;
            case ChatTypeManage.TALK_SEND_GIF:
                convertView = View.inflate(mContext,
                        R.layout.talk_list_item_send_gif, null);
                break;
            case ChatTypeManage.TALK_SEND_FILE:
                convertView = View.inflate(mContext,
                        R.layout.talk_list_item_send_file, null);
                break;
            case ChatTypeManage.TALK_SEND_CRAD:
                convertView = View.inflate(mContext,
                        R.layout.talk_list_item_send_crad, null);
                break;
            case ChatTypeManage.TALK_SEND_RED:
                convertView = View.inflate(mContext,
                        R.layout.talk_list_item_send_money, null);
                break;
            case ChatTypeManage.TALK_SEND_VIDEO_CHAT:
                convertView = View.inflate(mContext,
                        R.layout.talk_list_item_send_video_chat, null);
                break;
            case ChatTypeManage.TALK_SEND_OA:
                convertView = View.inflate(mContext,
                        R.layout.talk_list_item_send_oa, null);
                break;
            case ChatTypeManage.TALK_SEND_OA_NOTICE:
                convertView = View.inflate(mContext,
                        R.layout.talk_list_item_send_notice, null);
                break;
            case ChatTypeManage.TALK_SEND_TASK:
                convertView = View.inflate(mContext,
                        R.layout.talk_list_item_send_task, null);
                break;
            case ChatTypeManage.TALK_RECEIVED_NEWS:
                convertView = View.inflate(mContext,
                        R.layout.talk_list_item_received_news, null);
                break;
            case ChatTypeManage.TALK_VERIF_MSG:
                convertView = View.inflate(mContext,
                        R.layout.talk_list_item_system, null);
                break;
            case ChatTypeManage.TALK_RECEIVED_TRANSFER:
                convertView = View.inflate(mContext,
                        R.layout.talk_list_item_received_transfer, null);
                break;
            case ChatTypeManage.TALK_SEND_TRANSFER:
                convertView = View.inflate(mContext,
                        R.layout.talk_list_item_send_transfer, null);
                break;
            case ChatTypeManage.TALK_RECEIVED_CROWNFUND:
                convertView = View.inflate(mContext,
                        R.layout.talk_list_item_received_crownfund, null);
                break;
            case ChatTypeManage.TALK_SEND_CROWNFUND:
                convertView = View.inflate(mContext,
                        R.layout.talk_list_item_send_crownfund, null);
                break;
            case ChatTypeManage.TALK_CROWD_FUND_SYSTEM_INFO:
                convertView = View.inflate(mContext,
                        R.layout.talk_list_item_system, null);
                break;
            case ChatTypeManage.TALK_RECEIVED_INVIT_JOIN_GROUP:
                convertView = View.inflate(mContext,
                        R.layout.talk_list_item_received_invit_join_group, null);
                break;
            case ChatTypeManage.TALK_SEND_INVIT_JOIN_GROUP:
                convertView = View.inflate(mContext,
                        R.layout.talk_list_item_send_invi_join_group, null);
                break;
            case ChatTypeManage.TALK_SEND_RECEIVE_FUNDS:
                convertView = View.inflate(mContext,
                        R.layout.talk_list_item_send_receive_funds, null);
                break;
            case ChatTypeManage.TALK_RECEIVED_RECEIVE_FUNDS:
                convertView = View.inflate(mContext,
                        R.layout.talk_list_item_received_receive_funds, null);
                break;
            case ChatTypeManage.TALK_FUNDS_SYSTEM_INFO:
                convertView = View.inflate(mContext,
                        R.layout.talk_list_item_system, null);
                break;
            case ChatTypeManage.TALK_RECEIVED_VIDEO:
                convertView = View.inflate(mContext,
                        R.layout.talk_list_item_received_video, null);
                break;
            case ChatTypeManage.TALK_SEND_VIDEO:
                convertView = View.inflate(mContext,
                        R.layout.talk_list_item_send_video, null);
                break;
        }
        return convertView;
    }

    /**
     * 获取新闻布局
     *
     * @param convertView
     * @return
     */
    public static ChatItemViewHolder.NewsViewHolder getNewsViewHolder(View convertView) {
        ChatItemViewHolder.NewsViewHolder mNewsViewHolder = new ChatItemViewHolder().new NewsViewHolder();
        mNewsViewHolder.news_content_layout = (LinearLayout) convertView
                .findViewById(R.id.news_content_layout);
        return mNewsViewHolder;
    }

    /**
     * 获取红包系统消息布局
     *
     * @param convertView
     * @return
     */
    public static ChatItemViewHolder.RedSystemViewHolder getRedSystemViewHolder(View convertView) {
        ChatItemViewHolder.RedSystemViewHolder mRedSystemViewHolder = new ChatItemViewHolder().new RedSystemViewHolder();
        mRedSystemViewHolder.redContentText = (TextView) convertView
                .findViewById(R.id.red_content);
        return mRedSystemViewHolder;
    }

    /**
     * 接受文本消息布局
     *
     * @param convertView
     * @return
     */
    public static ChatItemViewHolder.ReceivedTextViewHolder getReceivedTextViewHolder(
            View convertView) {
        ChatItemViewHolder.ReceivedTextViewHolder receivedTextHolder = new ChatItemViewHolder().new ReceivedTextViewHolder();
        receivedTextHolder.received_text = (TextView) convertView
                .findViewById(R.id.received_text);
        receivedTextHolder.avatar = (RoundImageView) convertView
                .findViewById(R.id.avatar);
        receivedTextHolder.received_name = (TextView) convertView
                .findViewById(R.id.received_name);
        receivedTextHolder.group = convertView.findViewById(R.id.group);
        return receivedTextHolder;
    }

    /**
     * 获取收到的图片布局
     *
     * @param convertView
     * @return
     */
    public static ChatItemViewHolder.ReceivedImageViewHolder getReceivedImageViewHolder(
            View convertView) {
        ChatItemViewHolder.ReceivedImageViewHolder receivedImageHolder = new ChatItemViewHolder().new ReceivedImageViewHolder();
        receivedImageHolder.avatar = (RoundImageView) convertView
                .findViewById(R.id.avatar);
        receivedImageHolder.received_name = (TextView) convertView
                .findViewById(R.id.received_name);
        receivedImageHolder.received_image = (BubbleImageView) convertView
                .findViewById(R.id.received_image);
        receivedImageHolder.group = convertView
                .findViewById(R.id.received_image);
        return receivedImageHolder;
    }

    /**
     * 接受的语音布局
     *
     * @param convertView
     * @return
     */
    public static ChatItemViewHolder.ReceivedAudioViewHolder getReceivedAudioViewHolder(
            View convertView) {
        ChatItemViewHolder.ReceivedAudioViewHolder receivedAudioHolder = new ChatItemViewHolder().new ReceivedAudioViewHolder();
        receivedAudioHolder.group = convertView.findViewById(R.id.group);
        receivedAudioHolder.receied_duration = (TextView) convertView
                .findViewById(R.id.received_duration);
        receivedAudioHolder.received_record = (PlayRecordView) convertView
                .findViewById(R.id.received_record);
        receivedAudioHolder.received_loading = (CircularProgressView) convertView
                .findViewById(R.id.received_loading);
        receivedAudioHolder.received_read_status = (ImageView) convertView
                .findViewById(R.id.received_read_status);
        receivedAudioHolder.avatar = (RoundImageView) convertView
                .findViewById(R.id.avatar);
        receivedAudioHolder.received_name = (TextView) convertView
                .findViewById(R.id.received_name);
        return receivedAudioHolder;
    }

    /**
     * 接受的位置布局
     *
     * @param convertView
     * @return
     */
    public static ChatItemViewHolder.ReceivedLocationViewHolder getReceivedLocationViewHolder(
            View convertView) {
        ChatItemViewHolder.ReceivedLocationViewHolder receivedLocationHolder = new ChatItemViewHolder().new ReceivedLocationViewHolder();
        receivedLocationHolder.received_location = (LocationView) convertView
                .findViewById(R.id.received_location);
        receivedLocationHolder.avatar = (RoundImageView) convertView
                .findViewById(R.id.avatar);
        receivedLocationHolder.received_name = (TextView) convertView
                .findViewById(R.id.received_name);
        receivedLocationHolder.group = convertView.findViewById(R.id.group);
        return receivedLocationHolder;
    }

    /**
     * 接受的GIF布局
     *
     * @param convertView
     * @return
     */
    public static ChatItemViewHolder.ReceivedGifViewHolder getReceivedGifViewHolder(
            View convertView) {
        ChatItemViewHolder.ReceivedGifViewHolder receivedGifHolder = new ChatItemViewHolder().new ReceivedGifViewHolder();
        receivedGifHolder.avatar = (RoundImageView) convertView
                .findViewById(R.id.avatar);
        receivedGifHolder.received_name = (TextView) convertView
                .findViewById(R.id.received_name);
        receivedGifHolder.received_gif = (GifImageView) convertView
                .findViewById(R.id.received_gif);
        return receivedGifHolder;
    }

    /**
     * 接受的文件布局
     *
     * @param convertView
     * @return
     */
    public static ChatItemViewHolder.ReceivedFileViewHolder getReceivedFileViewHolder(
            View convertView) {
        ChatItemViewHolder.ReceivedFileViewHolder receivedFileHolder = new ChatItemViewHolder().new ReceivedFileViewHolder();
        receivedFileHolder.avatar = (RoundImageView) convertView
                .findViewById(R.id.avatar);
        receivedFileHolder.received_name = (TextView) convertView
                .findViewById(R.id.received_name);
        receivedFileHolder.received_file_type_name = (TextView) convertView
                .findViewById(R.id.received_file_type_name);
        receivedFileHolder.received_file_name = (TextView) convertView
                .findViewById(R.id.received_file_name_tv);
        receivedFileHolder.received_file_size = (TextView) convertView
                .findViewById(R.id.received_file_size_tv);
        receivedFileHolder.download_received_file_status = (TextView) convertView
                .findViewById(R.id.download_status);
        receivedFileHolder.group = convertView.findViewById(R.id.group);
        return receivedFileHolder;
    }

    /**
     * 接受的红包布局
     *
     * @param convertView
     * @return
     */
    public static ChatItemViewHolder.ReceivedRedViewHolder getReceivedRedViewHolder(
            View convertView) {
        ChatItemViewHolder.ReceivedRedViewHolder receivedRedViewHolder = new ChatItemViewHolder().new ReceivedRedViewHolder();
        receivedRedViewHolder.avatar = (RoundImageView) convertView
                .findViewById(R.id.avatar);
        receivedRedViewHolder.received_name = (TextView) convertView
                .findViewById(R.id.received_name);
        receivedRedViewHolder.received_money_content_tv = (TextView) convertView
                .findViewById(R.id.received_money_content_tv);
        receivedRedViewHolder.group = convertView.findViewById(R.id.group);
        return receivedRedViewHolder;
    }

    /**
     * 收到的转账布局
     *
     * @param convertView
     * @param mLongClickListener
     * @return
     */
    public static ChatItemViewHolder.ReceivedTransferViewHodler getGiroViewHodler(
            View convertView, OnLongClickListener mLongClickListener) {
        ChatItemViewHolder.ReceivedTransferViewHodler receivedGiroViewHodler = new ChatItemViewHolder().new ReceivedTransferViewHodler();
        receivedGiroViewHodler.avatar = (RoundImageView) convertView
                .findViewById(R.id.avatar);
        receivedGiroViewHodler.received_name = (TextView) convertView
                .findViewById(R.id.received_name);
        receivedGiroViewHodler.received_transfer_content_tv = (TextView) convertView
                .findViewById(R.id.received_transfer_content_tv);
        receivedGiroViewHodler.received_giro_source_tv = (TextView) convertView
                .findViewById(R.id.received_giro_source_tv);
        receivedGiroViewHodler.received_transfer_amount = (TextView) convertView
                .findViewById(R.id.received_transfer_amount);
        receivedGiroViewHodler.group = convertView.findViewById(R.id.group);
        receivedGiroViewHodler.group.setOnLongClickListener(mLongClickListener);
        convertView.setTag(receivedGiroViewHodler);
        return receivedGiroViewHodler;
    }

    /**
     * 发送转账
     *
     * @param convertView
     * @param mLongClickListener
     * @return
     */
    public static ChatItemViewHolder.SendTransferViewHolder getSendTransferViewHolder(
            View convertView, OnLongClickListener mLongClickListener) {
        ChatItemViewHolder.SendTransferViewHolder sendTransferViewHolder = new ChatItemViewHolder().new SendTransferViewHolder();
        sendTransferViewHolder.avatar = (RoundImageView) convertView
                .findViewById(R.id.avatar);
        sendTransferViewHolder.sent_name = (TextView) convertView
                .findViewById(R.id.sent_name);
        sendTransferViewHolder.send_loading = (CircularProgressView) convertView
                .findViewById(R.id.send_loading);
        sendTransferViewHolder.send_status = (ImageView) convertView
                .findViewById(R.id.send_status);
        sendTransferViewHolder.send_transfer_content_tv = (TextView) convertView
                .findViewById(R.id.send_transfer_content_tv);
        sendTransferViewHolder.send_transfer_amount_tv = (TextView) convertView
                .findViewById(R.id.send_transfer_amount_tv);
        sendTransferViewHolder.send_giro_source_tv = (TextView) convertView
                .findViewById(R.id.send_giro_source_tv);
        sendTransferViewHolder.group = convertView
                .findViewById(R.id.sent_group);
        sendTransferViewHolder.group.setOnLongClickListener(mLongClickListener);
        convertView.setTag(sendTransferViewHolder);
        return sendTransferViewHolder;
    }

    /**
     * 收到的众筹(江湖救急)布局
     *
     * @param convertView
     * @param mLongClickListener
     * @return
     */
    public static ChatItemViewHolder.ReceivedCrownFundViewHodler getReceivedCrownFundViewHodler(
            View convertView, OnLongClickListener mLongClickListener) {
        ChatItemViewHolder.ReceivedCrownFundViewHodler crownFundViewHodler = new ChatItemViewHolder().new ReceivedCrownFundViewHodler();
        crownFundViewHodler.avatar = (RoundImageView) convertView
                .findViewById(R.id.avatar);
        crownFundViewHodler.received_name = (TextView) convertView
                .findViewById(R.id.received_name);
        crownFundViewHodler.received_crowndfund_memo_tv = (TextView) convertView
                .findViewById(R.id.received_crowndfund_memo_tv);
        crownFundViewHodler.received_crownfund_total_money_tv = (TextView) convertView
                .findViewById(R.id.received_crownfund_total_money_tv);
        crownFundViewHodler.group = convertView.findViewById(R.id.group);
        crownFundViewHodler.group.setOnLongClickListener(mLongClickListener);
        convertView.setTag(crownFundViewHodler);
        return crownFundViewHodler;
    }

    /**
     * 收到的邀请加入群聊
     *
     * @param convertView
     * @param mLongClickListener
     * @return
     */
    public static ChatItemViewHolder.ReceivedInvitJoinGroupViewHodler getReceivedInvitJoinGroupViewHodler(
            View convertView, OnLongClickListener mLongClickListener) {
        ChatItemViewHolder.ReceivedInvitJoinGroupViewHodler invitJoinGroupViewHodler = new ChatItemViewHolder().new ReceivedInvitJoinGroupViewHodler();
        invitJoinGroupViewHodler.avatar = (RoundImageView) convertView
                .findViewById(R.id.avatar);
        invitJoinGroupViewHodler.received_name = (TextView) convertView
                .findViewById(R.id.received_name);
        invitJoinGroupViewHodler.received_invitation_join_group_desc = (TextView) convertView
                .findViewById(R.id.invitation_join_group_desc);
        invitJoinGroupViewHodler.received_invitation_join_group_avatar = (MaskImageView) convertView
                .findViewById(R.id.invitation_join_group_avatar);
        invitJoinGroupViewHodler.group = convertView.findViewById(R.id.group);
        invitJoinGroupViewHodler.group
                .setOnLongClickListener(mLongClickListener);
        convertView.setTag(invitJoinGroupViewHodler);
        return invitJoinGroupViewHodler;
    }

    /**
     * 发送接受经费
     *
     * @param convertView
     * @param mLongClickListener
     * @return
     */
    public static ChatItemViewHolder.SendReceiveFundsViewHodler getSendReceiveFundsViewHodler(
            View convertView, OnLongClickListener mLongClickListener) {
        ChatItemViewHolder.SendReceiveFundsViewHodler sendReceiveFundsViewHodler = new ChatItemViewHolder().new SendReceiveFundsViewHodler();
        sendReceiveFundsViewHodler.avatar = (RoundImageView) convertView
                .findViewById(R.id.avatar);
        sendReceiveFundsViewHodler.sent_name = (TextView) convertView
                .findViewById(R.id.sent_name);
        sendReceiveFundsViewHodler.send_loading = (CircularProgressView) convertView
                .findViewById(R.id.send_loading);
        sendReceiveFundsViewHodler.send_status = (ImageView) convertView
                .findViewById(R.id.send_status);
        sendReceiveFundsViewHodler.send_receive_funds_amount_tv = (TextView) convertView
                .findViewById(R.id.send_receive_funds_amount_tv);
        sendReceiveFundsViewHodler.group = convertView
                .findViewById(R.id.sent_group);
        sendReceiveFundsViewHodler.group
                .setOnLongClickListener(mLongClickListener);
        convertView.setTag(sendReceiveFundsViewHodler);
        return sendReceiveFundsViewHodler;
    }

    /**
     * 接受的名片
     *
     * @param convertView
     * @return
     */
    public static ChatItemViewHolder.ReceivedCradViewHolder getReceivedCradViewHolder(
            View convertView) {
        ChatItemViewHolder.ReceivedCradViewHolder receivedCradViewHolder = new ChatItemViewHolder().new ReceivedCradViewHolder();
        receivedCradViewHolder.avatar = (RoundImageView) convertView
                .findViewById(R.id.avatar);
        receivedCradViewHolder.received_name = (TextView) convertView
                .findViewById(R.id.received_name);
        receivedCradViewHolder.received_crad_avatar = (MaskImageView) convertView
                .findViewById(R.id.received_crad_avatar);
        receivedCradViewHolder.received_crad_name_text = (TextView) convertView
                .findViewById(R.id.received_crad_name_tv);
        receivedCradViewHolder.received_crad_type_text = (TextView) convertView
                .findViewById(R.id.received_crad_type_text);
        receivedCradViewHolder.group = convertView.findViewById(R.id.group);
        return receivedCradViewHolder;
    }

    /**
     * 接受到收经费消息类型
     *
     * @param convertView
     * @param mLongClickListener
     * @return
     */
    public static ChatItemViewHolder.ReceivedReceiveFundsViewHodler getReceivedReceiveFundsViewHodler(
            View convertView, OnLongClickListener mLongClickListener) {
        ChatItemViewHolder.ReceivedReceiveFundsViewHodler receivedReceiveFundsViewHodler = new ChatItemViewHolder().new ReceivedReceiveFundsViewHodler();
        receivedReceiveFundsViewHodler.avatar = (RoundImageView) convertView
                .findViewById(R.id.avatar);
        receivedReceiveFundsViewHodler.received_name = (TextView) convertView
                .findViewById(R.id.received_name);
        receivedReceiveFundsViewHodler.received_receive_funds_amount = (TextView) convertView
                .findViewById(R.id.received_receive_funds_amount);
        receivedReceiveFundsViewHodler.group = convertView
                .findViewById(R.id.group);
        receivedReceiveFundsViewHodler.group
                .setOnLongClickListener(mLongClickListener);
        convertView.setTag(receivedReceiveFundsViewHodler);
        return receivedReceiveFundsViewHodler;
    }

    /**
     * 接受视频聊天
     *
     * @param convertView
     * @return
     */
    public static ChatItemViewHolder.ReceivedVideoChatViewHolder getReceivedVideoChatViewHolder(
            View convertView) {
        ChatItemViewHolder.ReceivedVideoChatViewHolder receivedVideoChatViewHolder = new ChatItemViewHolder().new ReceivedVideoChatViewHolder();
        receivedVideoChatViewHolder.avatar = (RoundImageView) convertView
                .findViewById(R.id.avatar);
        receivedVideoChatViewHolder.received_name = (TextView) convertView
                .findViewById(R.id.received_name);
        receivedVideoChatViewHolder.received_video_chat_content = (TextView) convertView
                .findViewById(R.id.received_text);
        receivedVideoChatViewHolder.group = convertView
                .findViewById(R.id.group);
        return receivedVideoChatViewHolder;
    }

    /**
     * 接受的视频
     *
     * @param convertView
     * @return
     */
    public static ChatItemViewHolder.ReceivedVideoViewHodler getReceivedVideoViewHodler(View convertView) {
        ChatItemViewHolder.ReceivedVideoViewHodler receivedVideoViewHodler = new ChatItemViewHolder().new ReceivedVideoViewHodler();
        receivedVideoViewHodler.avatar = (RoundImageView) convertView
                .findViewById(R.id.avatar);
        receivedVideoViewHodler.received_name = (TextView) convertView
                .findViewById(R.id.received_name);
        receivedVideoViewHodler.received_video_first_frame_image = (BubbleImageView) convertView
                .findViewById(R.id.received_video_scree_image);
        receivedVideoViewHodler.group = convertView
                .findViewById(R.id.group);
        return receivedVideoViewHodler;
    }


    /**
     * 接受的OA消息
     *
     * @param convertView
     * @return
     */
    public static ChatItemViewHolder.ReceivedOAViewHolder getReceivedOAViewHolder(View convertView) {
        ChatItemViewHolder.ReceivedOAViewHolder receivedOAViewHolder = new ChatItemViewHolder().new ReceivedOAViewHolder();
        receivedOAViewHolder.avatar = (RoundImageView) convertView
                .findViewById(R.id.avatar);
        receivedOAViewHolder.received_name = (TextView) convertView
                .findViewById(R.id.received_name);
        receivedOAViewHolder.received_oa_content = (TextView) convertView
                .findViewById(R.id.received_oa_content_tv);
        receivedOAViewHolder.received_oa_iv = (MaskImageView) convertView
                .findViewById(R.id.received_oa_iv);
        receivedOAViewHolder.received_oa_title = (TextView) convertView
                .findViewById(R.id.received_oa_title);
        receivedOAViewHolder.received_oa_type = (TextView) convertView
                .findViewById(R.id.received_oa_type_tv);
        receivedOAViewHolder.group = convertView.findViewById(R.id.group);
        return receivedOAViewHolder;
    }

    /**
     * 接受OA通知
     *
     * @param convertView
     * @return
     */
    public static ChatItemViewHolder.ReceivedOANoticeViewHolder getReceivedOANoticeViewHolder(
            View convertView) {
        ChatItemViewHolder.ReceivedOANoticeViewHolder receivedOANoticeViewHolder = new ChatItemViewHolder().new ReceivedOANoticeViewHolder();
        receivedOANoticeViewHolder.avatar = (RoundImageView) convertView
                .findViewById(R.id.avatar);
        receivedOANoticeViewHolder.received_name = (TextView) convertView
                .findViewById(R.id.received_name);
        receivedOANoticeViewHolder.received_oa_notice_content = (TextView) convertView
                .findViewById(R.id.received_notice_content_tv);
        receivedOANoticeViewHolder.received_oa_notice_title = (TextView) convertView
                .findViewById(R.id.received_notice_title);
        receivedOANoticeViewHolder.received_oa_notice_type = (TextView) convertView
                .findViewById(R.id.received_notice_type_tv);
        receivedOANoticeViewHolder.group = convertView.findViewById(R.id.group);
        return receivedOANoticeViewHolder;
    }

    /**
     * 接受OA任务
     *
     * @param convertView
     * @return
     */
    public static ChatItemViewHolder.ReceivedOATaskViewHolder getReceivedOATaskViewHolder(
            View convertView) {
        ChatItemViewHolder.ReceivedOATaskViewHolder receivedOATaskViewHolder = new ChatItemViewHolder().new ReceivedOATaskViewHolder();
        receivedOATaskViewHolder.avatar = (RoundImageView) convertView
                .findViewById(R.id.avatar);
        receivedOATaskViewHolder.received_name = (TextView) convertView
                .findViewById(R.id.received_name);
        receivedOATaskViewHolder.received_task_content = (TextView) convertView
                .findViewById(R.id.received_task_content_tv);
        receivedOATaskViewHolder.received_task_title = (TextView) convertView
                .findViewById(R.id.received_task_title);
        receivedOATaskViewHolder.received_task_type = (TextView) convertView
                .findViewById(R.id.received_task_type_tv);
        receivedOATaskViewHolder.received_task_start_date = (TextView) convertView
                .findViewById(R.id.received_task_start_date);
        receivedOATaskViewHolder.received_task_end_date = (TextView) convertView
                .findViewById(R.id.received_task_end_date);
        receivedOATaskViewHolder.received_task_grade = (TextView) convertView
                .findViewById(R.id.received_task_grade);
        receivedOATaskViewHolder.group = convertView.findViewById(R.id.group);
        return receivedOATaskViewHolder;
    }

    /**
     * 发送的文本
     *
     * @param convertView
     * @return
     */
    public static ChatItemViewHolder.SendTextViewHolder getSendTextViewHolder(View convertView) {
        ChatItemViewHolder.SendTextViewHolder sendTextHolder = new ChatItemViewHolder().new SendTextViewHolder();
        sendTextHolder.send_text = (TextView) convertView
                .findViewById(R.id.sent_text);
        sendTextHolder.send_status = (ImageView) convertView
                .findViewById(R.id.send_status);
        sendTextHolder.send_loading = (CircularProgressView) convertView
                .findViewById(R.id.send_loading);
        sendTextHolder.avatar = (RoundImageView) convertView
                .findViewById(R.id.avatar);
        sendTextHolder.sent_name = (TextView) convertView
                .findViewById(R.id.sent_name);
        sendTextHolder.group = convertView.findViewById(R.id.sent_group);
        return sendTextHolder;
    }

    /**
     * 发送图片
     *
     * @param convertView
     * @return
     */
    public static ChatItemViewHolder.SendImageViewHolder getSendImageViewHolder(View convertView) {
        ChatItemViewHolder.SendImageViewHolder sendImageHolder = new ChatItemViewHolder().new SendImageViewHolder();
        sendImageHolder.send_image = (BubbleRightImageView) convertView
                .findViewById(R.id.sent_image);
        sendImageHolder.avatar = (RoundImageView) convertView
                .findViewById(R.id.avatar);
        sendImageHolder.send_status = (ImageView) convertView
                .findViewById(R.id.send_status);
        sendImageHolder.send_loading = (CircularProgressView) convertView
                .findViewById(R.id.send_loading);
        sendImageHolder.sent_name = (TextView) convertView
                .findViewById(R.id.sent_name);
        sendImageHolder.group = convertView.findViewById(R.id.sent_image);
        return sendImageHolder;
    }

    /**
     * 发送语音
     *
     * @param convertView
     * @return
     */
    public static ChatItemViewHolder.SendAudioViewHolder getSendAudioViewHolder(View convertView) {
        ChatItemViewHolder.SendAudioViewHolder sendAudioHolder = new ChatItemViewHolder().new SendAudioViewHolder();
        sendAudioHolder.avatar = (RoundImageView) convertView
                .findViewById(R.id.avatar);
        sendAudioHolder.send_record = (PlayRecordView) convertView
                .findViewById(R.id.sent_record);
        sendAudioHolder.send_duration = (TextView) convertView
                .findViewById(R.id.sent_duration);
        sendAudioHolder.send_status = (ImageView) convertView
                .findViewById(R.id.send_status);
        sendAudioHolder.send_loading = (CircularProgressView) convertView
                .findViewById(R.id.send_loading);
        sendAudioHolder.sent_name = (TextView) convertView
                .findViewById(R.id.sent_name);
        sendAudioHolder.group = (RelativeLayout) convertView
                .findViewById(R.id.sent_group);
        return sendAudioHolder;
    }

    /**
     * 发送地理位置
     *
     * @param convertView
     * @return
     */
    public static ChatItemViewHolder.SendLocationViewHolder getSendLocationViewHolder(
            View convertView) {
        ChatItemViewHolder.SendLocationViewHolder sendLocationHolder = new ChatItemViewHolder().new SendLocationViewHolder();
        sendLocationHolder.send_Location = (LocationView) convertView
                .findViewById(R.id.sent_location);
        sendLocationHolder.send_status = (ImageView) convertView
                .findViewById(R.id.send_status);
        sendLocationHolder.send_loading = (CircularProgressView) convertView
                .findViewById(R.id.send_loading);
        sendLocationHolder.avatar = (RoundImageView) convertView
                .findViewById(R.id.avatar);
        sendLocationHolder.sent_name = (TextView) convertView
                .findViewById(R.id.sent_name);
        sendLocationHolder.group = convertView.findViewById(R.id.sent_group);
        return sendLocationHolder;
    }

    /**
     * 发送GIF表情
     *
     * @param convertView
     * @return
     */
    public static ChatItemViewHolder.SendGifViewHolder getSendGifViewHolder(View convertView) {
        ChatItemViewHolder.SendGifViewHolder sendGifHolder = new ChatItemViewHolder().new SendGifViewHolder();
        sendGifHolder.send_gif = (GifImageView) convertView
                .findViewById(R.id.sent_gif);
        sendGifHolder.send_status = (ImageView) convertView
                .findViewById(R.id.send_status);
        sendGifHolder.send_loading = (CircularProgressView) convertView
                .findViewById(R.id.send_loading);
        sendGifHolder.avatar = (RoundImageView) convertView
                .findViewById(R.id.avatar);
        sendGifHolder.sent_name = (TextView) convertView
                .findViewById(R.id.sent_name);
        return sendGifHolder;
    }

    /**
     * 发送文件
     *
     * @param convertView
     * @return
     */
    public static ChatItemViewHolder.SendFileViewHolder getSendFileViewHolder(View convertView) {
        ChatItemViewHolder.SendFileViewHolder sendFileHolder = new ChatItemViewHolder().new SendFileViewHolder();
        sendFileHolder.avatar = (RoundImageView) convertView
                .findViewById(R.id.avatar);
        sendFileHolder.sent_name = (TextView) convertView
                .findViewById(R.id.sent_name);
        sendFileHolder.send_loading = (CircularProgressView) convertView
                .findViewById(R.id.send_loading);
        sendFileHolder.send_status = (ImageView) convertView
                .findViewById(R.id.send_status);
        sendFileHolder.send_file_type_name = (TextView) convertView
                .findViewById(R.id.send_file_type_name);
        sendFileHolder.send_file_name = (TextView) convertView
                .findViewById(R.id.send_file_name_tv);
        sendFileHolder.send_file_size = (TextView) convertView
                .findViewById(R.id.send_file_size_tv);
        sendFileHolder.send_file_status = (TextView) convertView
                .findViewById(R.id.send_file_status);
        sendFileHolder.group = convertView.findViewById(R.id.sent_group);
        return sendFileHolder;
    }

    /**
     * 发送名片
     *
     * @param convertView
     * @return
     */
    public static ChatItemViewHolder.SendCradViewHolder getSendCradViewHolder(View convertView) {
        ChatItemViewHolder.SendCradViewHolder sendCradViewHolder = new ChatItemViewHolder().new SendCradViewHolder();
        sendCradViewHolder.avatar = (RoundImageView) convertView
                .findViewById(R.id.avatar);
        sendCradViewHolder.sent_name = (TextView) convertView
                .findViewById(R.id.sent_name);
        sendCradViewHolder.send_loading = (CircularProgressView) convertView
                .findViewById(R.id.send_loading);
        sendCradViewHolder.send_status = (ImageView) convertView
                .findViewById(R.id.send_status);
        sendCradViewHolder.send_crad_avatar = (MaskImageView) convertView
                .findViewById(R.id.send_crad_avatar);
        sendCradViewHolder.send_crad_name_text = (TextView) convertView
                .findViewById(R.id.send_crad_name_tv);
        sendCradViewHolder.send_crad_type_text = (TextView) convertView
                .findViewById(R.id.send_crad_type_text);
        sendCradViewHolder.group = convertView.findViewById(R.id.sent_group);
        return sendCradViewHolder;
    }

    /**
     * 发送红包
     *
     * @param convertView
     * @return
     */
    public static ChatItemViewHolder.SendRedViewHolder getSendRedViewHolder(View convertView) {
        ChatItemViewHolder.SendRedViewHolder sendRedViewHolder = new ChatItemViewHolder().new SendRedViewHolder();
        sendRedViewHolder.avatar = (RoundImageView) convertView
                .findViewById(R.id.avatar);
        sendRedViewHolder.sent_name = (TextView) convertView
                .findViewById(R.id.sent_name);
        sendRedViewHolder.send_loading = (CircularProgressView) convertView
                .findViewById(R.id.send_loading);
        sendRedViewHolder.send_status = (ImageView) convertView
                .findViewById(R.id.send_status);
        sendRedViewHolder.send_money_content_tv = (TextView) convertView
                .findViewById(R.id.send_money_content_tv);
        sendRedViewHolder.group = convertView.findViewById(R.id.sent_group);
        return sendRedViewHolder;
    }

    /**
     * 发送众筹(江湖救急)
     *
     * @param convertView
     * @param mLongClickListener
     * @return
     */
    public static ChatItemViewHolder.SendCrownFundViewHodler getSendCrownFundViewHodler(
            View convertView, OnLongClickListener mLongClickListener) {
        ChatItemViewHolder.SendCrownFundViewHodler sendCrownFundViewHodler = new ChatItemViewHolder().new SendCrownFundViewHodler();
        sendCrownFundViewHodler.avatar = (RoundImageView) convertView
                .findViewById(R.id.avatar);
        sendCrownFundViewHodler.sent_name = (TextView) convertView
                .findViewById(R.id.sent_name);
        sendCrownFundViewHodler.send_loading = (CircularProgressView) convertView
                .findViewById(R.id.send_loading);
        sendCrownFundViewHodler.send_status = (ImageView) convertView
                .findViewById(R.id.send_status);
        sendCrownFundViewHodler.send_crowndfund_memo_tv = (TextView) convertView
                .findViewById(R.id.send_crowndfund_memo_tv);
        sendCrownFundViewHodler.send_crownfund_total_money_tv = (TextView) convertView
                .findViewById(R.id.send_crownfund_total_money_tv);
        sendCrownFundViewHodler.group = convertView
                .findViewById(R.id.sent_group);
        sendCrownFundViewHodler.group
                .setOnLongClickListener(mLongClickListener);
        convertView.setTag(sendCrownFundViewHodler);
        return sendCrownFundViewHodler;
    }

    /**
     * 发送邀请加入群聊
     *
     * @param convertView
     * @return
     */
    public static ChatItemViewHolder.SendInvitJoinGroupViewHodler getSendInvitJoinGroupViewHodler(
            View convertView, OnLongClickListener mLongClickListener) {
        ChatItemViewHolder.SendInvitJoinGroupViewHodler sendInvitJoinGroupViewHodler = new ChatItemViewHolder().new SendInvitJoinGroupViewHodler();
        sendInvitJoinGroupViewHodler.avatar = (RoundImageView) convertView
                .findViewById(R.id.avatar);
        sendInvitJoinGroupViewHodler.sent_name = (TextView) convertView
                .findViewById(R.id.sent_name);
        sendInvitJoinGroupViewHodler.send_loading = (CircularProgressView) convertView
                .findViewById(R.id.send_loading);
        sendInvitJoinGroupViewHodler.send_status = (ImageView) convertView
                .findViewById(R.id.send_status);
        sendInvitJoinGroupViewHodler.send_invi_join_group_avatar = (MaskImageView) convertView
                .findViewById(R.id.send_invi_join_group_avatar);
        sendInvitJoinGroupViewHodler.send_invi_join_group_desc = (TextView) convertView
                .findViewById(R.id.send_invi_join_group_desc);
        sendInvitJoinGroupViewHodler.group = convertView
                .findViewById(R.id.sent_group);
        sendInvitJoinGroupViewHodler.group
                .setOnLongClickListener(mLongClickListener);
        convertView.setTag(sendInvitJoinGroupViewHodler);
        return sendInvitJoinGroupViewHodler;
    }

    /**
     * 发送视频聊天
     *
     * @param convertView
     * @return
     */
    public static ChatItemViewHolder.SendVideoChatViewHolder getSendVideoChatViewHolder(
            View convertView) {
        ChatItemViewHolder.SendVideoChatViewHolder sendVideoChatViewHolder = new ChatItemViewHolder().new SendVideoChatViewHolder();
        sendVideoChatViewHolder.avatar = (RoundImageView) convertView
                .findViewById(R.id.avatar);
        sendVideoChatViewHolder.sent_name = (TextView) convertView
                .findViewById(R.id.sent_name);
        sendVideoChatViewHolder.send_loading = (CircularProgressView) convertView
                .findViewById(R.id.send_loading);
        sendVideoChatViewHolder.send_status = (ImageView) convertView
                .findViewById(R.id.send_status);
        sendVideoChatViewHolder.send_video_chat_content = (TextView) convertView
                .findViewById(R.id.sent_text);
        sendVideoChatViewHolder.group = convertView
                .findViewById(R.id.sent_group);
        return sendVideoChatViewHolder;
    }


    /**
     * 发送的视频
     *
     * @param convertView
     * @return
     */
    public static ChatItemViewHolder.SendVideoViewHolder getSendVideoViewHolder(
            View convertView) {
        ChatItemViewHolder.SendVideoViewHolder sendVideoViewHolder = new ChatItemViewHolder().new SendVideoViewHolder();
        sendVideoViewHolder.avatar = (RoundImageView) convertView
                .findViewById(R.id.avatar);
        sendVideoViewHolder.sent_name = (TextView) convertView
                .findViewById(R.id.sent_name);
        sendVideoViewHolder.send_loading = (CircularProgressView) convertView
                .findViewById(R.id.send_loading);
        sendVideoViewHolder.send_status = (ImageView) convertView
                .findViewById(R.id.send_status);
        sendVideoViewHolder.send_video_first_frame_image = (MaskImageView) convertView
                .findViewById(R.id.sent_video_scree_image);
        sendVideoViewHolder.group = convertView
                .findViewById(R.id.sent_group);
        return sendVideoViewHolder;
    }

    /**
     * 发送OA消息
     *
     * @param convertView
     * @return
     */
    public static ChatItemViewHolder.SendOAViewHolder getSendOAViewHolder(View convertView) {
        ChatItemViewHolder.SendOAViewHolder sendOAViewHolder = new ChatItemViewHolder().new SendOAViewHolder();
        sendOAViewHolder.avatar = (RoundImageView) convertView
                .findViewById(R.id.avatar);
        sendOAViewHolder.sent_name = (TextView) convertView
                .findViewById(R.id.sent_name);
        sendOAViewHolder.send_loading = (CircularProgressView) convertView
                .findViewById(R.id.send_loading);
        sendOAViewHolder.send_status = (ImageView) convertView
                .findViewById(R.id.send_status);
        sendOAViewHolder.send_oa_iv = (MaskImageView) convertView
                .findViewById(R.id.send_oa_iv);
        sendOAViewHolder.send_oa_content = (TextView) convertView
                .findViewById(R.id.send_oa_content_tv);
        sendOAViewHolder.send_oa_title = (TextView) convertView
                .findViewById(R.id.send_oa_title_tv);
        sendOAViewHolder.send_oa_type = (TextView) convertView
                .findViewById(R.id.send_oa_type_tv);
        sendOAViewHolder.group = convertView.findViewById(R.id.sent_group);
        return sendOAViewHolder;
    }

    /**
     * 发送OA通知
     *
     * @param convertView
     * @return
     */
    public static ChatItemViewHolder.SendOANoticeViewHolder getSendOANoticeViewHolder(
            View convertView) {
        ChatItemViewHolder.SendOANoticeViewHolder sendOANoticeViewHolder = new ChatItemViewHolder().new SendOANoticeViewHolder();
        sendOANoticeViewHolder.avatar = (RoundImageView) convertView
                .findViewById(R.id.avatar);
        sendOANoticeViewHolder.sent_name = (TextView) convertView
                .findViewById(R.id.sent_name);
        sendOANoticeViewHolder.send_loading = (CircularProgressView) convertView
                .findViewById(R.id.send_loading);
        sendOANoticeViewHolder.send_status = (ImageView) convertView
                .findViewById(R.id.send_status);
        sendOANoticeViewHolder.send_oa_notice_content = (TextView) convertView
                .findViewById(R.id.send_notice_content_tv);
        sendOANoticeViewHolder.send_oa_notice_title = (TextView) convertView
                .findViewById(R.id.send_notice_title_tv);
        sendOANoticeViewHolder.send_oa_notice_type = (TextView) convertView
                .findViewById(R.id.send_notice_type_tv);
        sendOANoticeViewHolder.group = convertView
                .findViewById(R.id.sent_group);
        return sendOANoticeViewHolder;
    }

    /**
     * 发送OA任务
     *
     * @param convertView
     * @return
     */
    public static ChatItemViewHolder.SendOATaskViewHolder getSendOATaskViewHolder(View convertView) {
        ChatItemViewHolder.SendOATaskViewHolder sendOATaskViewHolder = new ChatItemViewHolder().new SendOATaskViewHolder();
        sendOATaskViewHolder.avatar = (RoundImageView) convertView
                .findViewById(R.id.avatar);
        sendOATaskViewHolder.sent_name = (TextView) convertView
                .findViewById(R.id.sent_name);
        sendOATaskViewHolder.send_loading = (CircularProgressView) convertView
                .findViewById(R.id.send_loading);
        sendOATaskViewHolder.send_status = (ImageView) convertView
                .findViewById(R.id.send_status);
        sendOATaskViewHolder.send_task_content = (TextView) convertView
                .findViewById(R.id.send_task_content_tv);
        sendOATaskViewHolder.send_task_title = (TextView) convertView
                .findViewById(R.id.send_task_title_tv);
        sendOATaskViewHolder.send_task_type = (TextView) convertView
                .findViewById(R.id.send_task_type_tv);
        sendOATaskViewHolder.send_task_grade = (TextView) convertView
                .findViewById(R.id.send_task_grade);
        sendOATaskViewHolder.send_task_start_date = (TextView) convertView
                .findViewById(R.id.send_task_start_date);
        sendOATaskViewHolder.send_task_end_date = (TextView) convertView
                .findViewById(R.id.send_task_end_date);
        sendOATaskViewHolder.group = convertView.findViewById(R.id.sent_group);
        return sendOATaskViewHolder;
    }

}
